package o;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.Map;

public class eui extends BaseSharedPref {
    public eui(SharedPreferences sharedPreferences) {
        this.ˏ = sharedPreferences;
    }

    public eui(String str) {
        this.ˏ = ContentManager.getInstant().getContext().getSharedPreferences(str, 0);
    }

    public void ˏ(String str, String str2) {
        try {
            String ˏ = dnk.ˏ(evh.ˋ());
            String ˎ = evh.ˊ().ˎ(str2, ˏ);
            StringBuilder stringBuilder = new StringBuilder(256);
            stringBuilder.append(ˎ);
            stringBuilder.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
            stringBuilder.append(ˏ);
            ˋ(str, dnk.ˏ(stringBuilder.toString().getBytes("UTF-8")));
        } catch (Exception e) {
            Logger.e("SharedPreferencesWrapper", "putSecretString error");
        }
    }

    public String ˊ(String str, String str2) {
        try {
            String ॱ = ॱ(str, str2);
            if (ॱ == null || ॱ.equals(str2)) {
                return str2;
            }
            String[] split = new String(dnk.ˎ(ॱ), "UTF-8").split("\\|");
            String ॱ2;
            if (split.length <= 1) {
                ॱ2 = evh.ˊ().ॱ(ॱ, ˊ());
                if (ॱ2 == null) {
                    ʼ(str);
                    return str2;
                }
                if (!ॱ.equals(ॱ2)) {
                    ˏ(str, ॱ2);
                }
                return ॱ2;
            }
            ॱ2 = evh.ˊ().ॱ(split[0], split[1]);
            if (ॱ2 != null) {
                return ॱ2;
            }
            ʼ(str);
            return str2;
        } catch (Exception e) {
            Logger.e("SharedPreferencesWrapper", "getSecretString error");
            return str2;
        }
    }

    public Editor ʼॱ() {
        return this.ˏ.edit();
    }

    public Map<String, ?> ʿ() {
        return this.ˏ.getAll();
    }

    public boolean ॱॱ(String str) {
        return this.ˏ.contains(str);
    }

    public void ˏˏ() {
        Editor edit = this.ˏ.edit();
        edit.clear();
        edit.commit();
    }

    public String ˊ() {
        return epr.ˎ().ॱ();
    }
}
